# 不定长参数and    不定长的关键字参数!!!!!!!!!!!两个foo函数
# foo_add1 excute time:0.00 s
# foo2 excute time:0.02 s
# None
# None

import time

def foo_add1(a, b):
    count = 1
    while True:
        if count > a ** b:
            break
        count += 1


def foo2(a, b, c):
    count = 1
    while True:
        if count > a ** b * c:
            break
        count += 1


def clock_it_time(func, *args, **kwargs):
    start_time = time.time()
    result = func(*args, **kwargs)  # 执行这个函数，默认返回none
    end_time = time.time()
    print(f"{func.__name__} excute time:{format(end_time - start_time, '.2f')} s")
    return result

res1 = clock_it_time(foo_add1, 10, 4)
res2 = clock_it_time(foo2, 10, 4, 3)
# print(res1)
# print(res2)




